<?php
$category = $this->category;
$total = $this->total;
$ads = $this->ads;
$now = new \DateTime();
?>

<p style="margin-bottom: 20px;">Объявлений в рубрике : <b><?php echo $total ?></b></p>

<?php foreach ($ads as $ad): ?>
    <? $class = $now < $ad['promotedDate'] ? "promoted" : false ?>
    <div class="<?= $class ?>">

        <div style="float:right;margin-right: 30px;">[<?php echo $ad['date']->format('m/d/Y') ?>]</div>
         <div style="padding-left: 20px;">
           Автор: <i><?php echo $this->escape($ad['author']); ?></i> (<a href='mailto:<?php echo $this->escape($ad['email']); ?>'><?php echo $this->escape($ad['email']); ?></a>)
           <br>
            Телефон: <span style="color: #0088CC; "><?php echo $this->escape($ad['phone']); ?></span>
         </div>
        <div style="min-height: 1px;margin-bottom: 20px;clear: both;"></div>
        <p style="text-indent: 20px;"><?php echo $ad['content']; ?></p>

    </div>
        <hr>
<?php endforeach; ?>

<?php echo $this->partial('/paginator/common.phtml', array('paginator' => $this->paginator)) ?>